import Vue from 'vue'
import Vuex from '../vuex.js'

Vue.use(Vuex)

let  store =  new  Vuex.Store({
   state: {
     totalPrice: 88,
     queryStore: ''
   },
   getters: {
     getTotal (state) {
       console.log("gettotal")
       return  state.totalPrice
     },
     getQuery(state){
       return state.queryStore
     }
   },
   mutations: {
     increment (state, price) {
       state.totalPrice += price
     },
     refreshQuery(state, val){
       state.queryStore = val
       console.log("state.refre----"+state.queryStore)
     }
   },
   actions: {
     increase (context, price) {
       context.commit( 'increment' , price)
     }
   }
})

export default store;
